package com.xunyin.modules.mtrefund.service;


import com.xunyin.common.service.BaseService;
import com.xunyin.modules.mtrefund.domain.MtRefund;
import com.xunyin.modules.mtrefund.service.dto.RefundDto;
import com.xunyin.modules.user.domain.YxUser;
import com.xunyin.pagination.PaginationRequest;
import com.xunyin.pagination.PaginationResponse;
import com.xunyin.web.ResponseObject;

import java.util.Date;
import java.util.Map;

/**
 * 售后业务接口
 *
 * Created by xunyinyunshang <3594419785@qq.com>
 * CopyRight 讯音云商 https://www.tonetn.com
 */
public interface RefundService extends BaseService<MtRefund> {

    /**
     * 分页查询列表
     *
     * @param paginationRequest
     * @return
     */
    PaginationResponse<MtRefund> getRefundListByPagination(PaginationRequest paginationRequest) ;

    /**
     * 获取用户的售后订单
     * @param paramMap 查询参数
     * @throws
     * */
    ResponseObject getUserRefundList(Map<String, Object> paramMap);

    /**
     * 创建售后订单
     *
     * @param reqDto
     */
    MtRefund createRefund(RefundDto reqDto);

    /**
     * 根据ID获取售后订单信息
     *
     * @param id ID
     */
    RefundDto getRefundById(Integer id) ;

    /**
     * 根据订单ID获取售后订单信息
     *
     * @param  orderId
     */
    MtRefund getRefundByOrderId(Integer orderId);

    /**
     * 更新售后订单
     * @param  reqDto
     * */
    MtRefund updateRefund(RefundDto reqDto);

    /**
     * 同意售后订单
     * @param  reqDto
     * */
    MtRefund agreeRefund(RefundDto reqDto);

    /**
     * 发起退款
     * @param orderId
     * @param refundAmount
     * @param remark
     * @param user
     * throws BusinessCheckException;
     * */
    Boolean doRefund(Integer orderId, String refundAmount, String remark, YxUser user);

    /**
     * 获取售后订单总数
     * */
    Long getRefundCount(Date beginTime, Date endTime);
}
